package br.com.healthy.model.entity;

import java.util.Date;
/**
 * @author Dieb
 *
 */
public class Consult {

private int id;
	
	private Dentist dentist;
	
	private Patient patient;
	
	private Date dateBeginning;
	
	private double value;
	
	private Treatment treatment;
	
	private Odontogram odontogram;
	
	public Consult(int id, Dentist dentist, Patient patient,
			Date dateBeginning, double valor, Treatment treatment,
			Odontogram odontogram, double value) {
		super();
		this.id = id;
		this.dentist = dentist;
		this.patient = patient;
		this.dateBeginning = dateBeginning;
		this.value = value;
		this.treatment = treatment;
		this.odontogram = odontogram;
	}

	public Consult() {
		super();
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the dentist
	 */
	public Dentist getDentist() {
		return dentist;
	}

	/**
	 * @param dentist the dentist to set
	 */
	public void setDentist(Dentist dentist) {
		this.dentist = dentist;
	}

	/**
	 * @return the patient
	 */
	public Patient getPatient() {
		return patient;
	}

	/**
	 * @param patient the patient to set
	 */
	public void setPatient(Patient patient) {
		this.patient = patient;
	}

	/**
	 * @return the dateBeginning
	 */
	public Date getDateBeginning() {
		return dateBeginning;
	}

	/**
	 * @param dateBeginning the dateBeginning to set
	 */
	public void setDateBeginning(Date dateBeginning) {
		this.dateBeginning = dateBeginning;
	}

	/**
	 * @return the value
	 */
	public double getValue() {
		return value;
	}

	/**
	 * @param value the value to set
	 */
	public void setValue(double value) {
		this.value = value;
	}

	/**
	 * @return the treatment
	 */
	public Treatment getTreatment() {
		return treatment;
	}

	/**
	 * @param treatment the treatment to set
	 */
	public void setTreatment(Treatment treatment) {
		this.treatment = treatment;
	}

	/**
	 * @return the odontogram
	 */
	public Odontogram getOdontogram() {
		return odontogram;
	}

	/**
	 * @param odontogram the odontogram to set
	 */
	public void setOdontogram(Odontogram odontogram) {
		this.odontogram = odontogram;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((dateBeginning == null) ? 0 : dateBeginning.hashCode());
		result = prime * result + ((dentist == null) ? 0 : dentist.hashCode());
		result = prime * result + id;
		result = prime * result
				+ ((odontogram == null) ? 0 : odontogram.hashCode());
		result = prime * result + ((patient == null) ? 0 : patient.hashCode());
		result = prime * result
				+ ((treatment == null) ? 0 : treatment.hashCode());
		long temp;
		temp = Double.doubleToLongBits(value);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Consult other = (Consult) obj;
		if (dateBeginning == null) {
			if (other.dateBeginning != null)
				return false;
		} else if (!dateBeginning.equals(other.dateBeginning))
			return false;
		if (dentist == null) {
			if (other.dentist != null)
				return false;
		} else if (!dentist.equals(other.dentist))
			return false;
		if (id != other.id)
			return false;
		if (odontogram == null) {
			if (other.odontogram != null)
				return false;
		} else if (!odontogram.equals(other.odontogram))
			return false;
		if (patient == null) {
			if (other.patient != null)
				return false;
		} else if (!patient.equals(other.patient))
			return false;
		if (treatment == null) {
			if (other.treatment != null)
				return false;
		} else if (!treatment.equals(other.treatment))
			return false;
		if (Double.doubleToLongBits(value) != Double
				.doubleToLongBits(other.value))
			return false;
		return true;
	}
	
}
